<template>
  <section class="recommend_detail ling-top-text">
    <h2>公司详情</h2>
    <div class="company_item_box">
      <h3>
        <span class="van-ellipsis result-list-company">{{ detail.name }}</span>
      </h3>
    </div>
    <div class="company_item_box" v-if="detail.logoUrl">
      <img :src="detail.logoUrl" />
    </div>
    <div class="company_detail">
      <h4>公司介绍</h4>
      <p>{{ detail.description }}</p>
    </div>
  </section>
</template>
<script>
import { getRecommendCompanyDetail } from '@/api/company'
export default {
  name: 'RecommendCompanyDetail',
  data() {
    return {
      detail: {},
    }
  },
  computed: {
    id() {
      return this.$route.params.id
    },
  },
  async created() {
    const res = await getRecommendCompanyDetail(this.id)
    this.detail = res || {}
  },
}
</script>

<style lang='less' scoped>
.recommend_detail {
  .company_item_box {
    padding: 0 20px 20px;
    background: white;
    h3 {
      color: #666;
      font-size: 12px;
      // border-bottom: 1px solid #efefef;
      display: flex;
      flex-direction: column;
      padding: 17px 0;
    }
    img {
      max-width: 100%;
    }
  }
  .company_detail {
    margin-top: 13px;
    padding: 17px 20px 20px;
    border-top: 1px solid #efefef;

    h4 {
      font-size: 12px;
      color: #333;
      margin-bottom: 10px;
    }
    p {
      font-size: 12px;
      color: #666;
      line-height: 20px;
      white-space: pre-line;
    }
  }
}
</style>